{include file="common/head"}
<head>
  <title>积分账单</title>

  <style type="text/css">
      #top{background: #f60;color: #fff;border-bottom:1px solid rgba(0,0,0,0.1);max-width: 800px;}
      .mb-3{margin-bottom:0!important;}
  </style>    
</head>
<body style="max-width: 800px;background: #f60;">
  <div id="header"></div>
  <div id="top" class="row text-center" >
    <div class="col-2 text-center">
      <span class="bi-chevron-left btn-back"></span>
    </div>
    <div class="col-8 text-center">积分账单</div>
    <div class="col-2 text"></div>
  </div>

    <div class="container-fluid" >
      <div style="height: 50px;"></div>
      <div class="btn-group" style="border-bottom: 1px solid #f00;">
        <button class="btn btn-sm btn-warning btn-cost1">消费积分</button>
        <button class="btn btn-sm btn-cost2">司机积分</button>
      </div>      
      <div id="content" style="margin: 10px 0;border-radius:10px;border:1px solid #555;background: #fff;padding: 0 5px;">


      <div id="cost1">
        <div class="text-center">消费积分</div>
        <table class="table table-sm table-striped" >
          
          <thead>
            <th>单号</th>
            <th>日期</th>
            <th>积分</th> 
            <th>备注</th>
          
          </thead>
          <tbody>
            
            {foreach $data['cost1'] as $k=>$cost1}
            <tr>
              <td>{$cost1['order_no']}</td>
              <td>{$cost1['create_time']}</td>
              <td>{$cost1['price1']}</td>
              <td>{$cost1['memo']}</td>
            </tr>
            {/foreach}
          </tbody>
        </table>
      </div>

      <div id="cost2" style="display: none;">
      <div class="text-center">司机积分</div>
      <table class="table table-sm table-striped" >
        <thead>
          <th>单号</th>
          <th>日期</th>
          <th>积分</th> 
          <th>备注</th>
        
        </thead>

        <tbody>
          {foreach $data['cost2'] as $k=>$cost2}
          <tr>
            <td>{$cost2['order_no']}</td>
            <td>{$cost2['create_time']}</td>
            <td>{$cost2['price1']}</td>
            <td>{$cost2['memo']}</td>
          </tr>
          {/foreach}
        </tbody>
      </table>
      </div>    
    </div>
    </div>

<script type="text/javascript">
$(document).ready(function(){

    $(".btn-back").on('click',function(){
        window.history.back();
    })

    $(".btn-cost1").on('click',function(){
      $(".btn-cost2").removeClass('btn-warning');
      $(this).addClass('btn-warning');
      $("#cost1").show();
      $("#cost2").hide();
    })
  
    $(".btn-cost2").on('click',function(){
      $(".btn-cost1").removeClass('btn-warning');
      $(this).addClass('btn-warning');
      $("#cost2").show();
      $("#cost1").hide();
    })

})


</script>


</body>
</html>
